<html>
    <head>
        <style>
            #adjustForm {
                font-family: Verdana, Geneva, sans-serif;
                font-size: 12px;
            }
        </style>
        <script>
            $(function() {
                $("#datepicker").datepicker({
                    yearRange: 'c-0:c+10',
                    numberOfMonths: 1,
                    stepMonths: 1,
                    minDate: new Date(),
                    dateFormat: 'd/mm/yy',
                    hideIfNoPrevNext: true
                });
                $('#semDataLimite').prop('value', '0');
            });
        </script>
    </head>
    <body>
        <div id="adjustForm">
            <form name="cadastrar_mensagem" method="POST" action="" >
                <p>
                    <label for="title">Título</label>
                    <br />
                    <input type="text" name="title">
                </p>
                <p>
                    <input type="checkbox" name="exibir"  value="1"> 
                </p>
                <script>
                    var editor = CKEDITOR.replace('editor');
                </script>
                <label for="context">Mensagem</label>
                <br />
                <textarea id="editor" name="context" rows="10" cols="50"></textarea> 
                <br>                
                <div>
                    <p>
                        <label for="datalimite">Data Limite</label>
                        <br>
                        <input id="datepicker" name="datalimite" type="text" class="datalimite"/>
                    </p>
                    <label for="hora">Hora</label>
                    &nbsp &nbsp
                    <label for="minuto">Min.</label>
                    <br>
                    <select name="hora" class="datalimite">
                        <?php
                        for ($i = 0; $i <= 23; $i++) {

                            echo $i < 10 ? "<option value='0$i'>0$i</option>" : "<option value='$i'>$i</option>";
                        }
                        ?>
                    </select>
                    <select name="minuto" class="datalimite">
                        <?php
                        for ($i = 0; $i <= 59; $i++) {

                            echo $i < 10 ? "<option value='0$i'>0$i</option>" : "<option value='$i'>$i</option>";
                        }
                        ?>
                    </select>
                </div>
                <br>
                <input type="checkbox" value="0" name="semdatalimite" id="semDataLimite">
                <label for="semdatalimite">Sem Data Limite</label>
                <span id='form-submit-data' class="adicionar">Publicar</span>
            </form>
        </div>
        <script>
            $('#semDataLimite').bind('click', function() {
                if ($(this).is(':checked') === true) {
                    $('.datalimite').prop('disabled', true);
                    $('.datalimite').prop('value', '');
                    $('#semDataLimite').prop('value', '1');
                } else {
                    $('.datalimite').prop('disabled', false);
                    $('#semDataLimite').prop('value', '0');
                }
            });
        </script>
    </body>
</html>